package main

import "fmt"

func main() {
	var n1 int32 = 10
	var n2 int32 = 100
	swap(&n1, &n2)
	fmt.Println("n1=", n1, "n2=", n2)
}

//交换两个数的值
func swap(n1 *int32, n2 *int32) {
	tmp := *n1
	*n1 = *n2
	*n2 = tmp
}
